#include "BuyStock.h"

int MaxIncome(int* data, int num)
{
	int income = 0;
	for (int i = 0; i < num - 1; ++i)
	{
		if (data[i + 1] > data[i])
		{
			income += data[i + 1] - data[i];
		}
	}

	return income;
}

